home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_2
/
toolbox
< prev
next >
Wrap
Internet Message Format
|
1995-03-31
|
23KB
From helens!shelby!rutgers!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!mcgill-vision!jean Wed May 23 05:29:05 PDT 1990
Status: RO
Article 1726 of comp.sys.handhelds:
Path: helens!shelby!rutgers!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!mcgill-vision!jean
>From: jean@mcgill-vision.uucp (Pierre Racz)
Newsgroups: comp.sys.handhelds
Subject: An HP48 tool box
Message-ID: <1990May23.013801.7712@larry.mcrcim.mcgill.edu>
Date: 23 May 90 01:38:01 GMT
Sender: root@larry.mcrcim.mcgill.edu (el Root)
Reply-To: pierrer@pike.ee.mcgill.ca (Pierre Racz)
Organization: Electrical Engineering McGill University
Lines: 461
%%HP: T(3)A(R)F(.);
@ Name : TOOLS - Self extracting toolbox.
@ Author : Pierre Racz & Gregor Winslow
@ Email : pierrer <at> pike.ee.mcgill.ca
@ Date : 90-04-29
@ Release : 1.0
@
@ Checksum : # 4494h
@ Bytes : 2,175.5
@
@ Descrip :
@ Self extracting list of functions.
@ This program is designed to setup the HP48SX with global
@ utilities, variables and directories.
@
@ Simply execute it in the directory of your choice (presumably
@ the ROOT).
@
@ The following functions are extracted:
@
@ IOTA Create a list of integers.
@ LOP Apply an operator to elements of a list.
@ LPP Apply an operator on elements of two lists in parallel.
@ LRED Reduce a list into a scalar given an operator.
@ LRNG Returns the Minimum and Maximum of a list.
@ LINV Invert a list
@ LST\-> Shift a list right
@ LST\<- Shift a list left
@ LCONVL Produces a Linear Convolution of two lists.
@ LOOP Apply an operator n times.
@ FROMTO Generate n+1 numbers in given range.
@ GCD Greatest Common Divisor
@ LCM Least Common Multiple
@ POLY Create a polynomial algebraic form list of coefficients.
@ BINO Create a binomial algebraic form list of roots.
@ SYND Synthetic division of two polynomials.
@ EXCO Fully expand then fully collect.
@ REVAL Fully evaluate.
@
@ The following empty directories are created:
@
@ EE Engineering applications
@ ETC Miscellaneous applications
@ ECON Time Value of Money
@ HELP General information storage
@ STATS Stat functions
@ TMP Temp
@
@ The following (dummy) variables are created. They are
@ essentially place holders for variables that the system
@ automatically creates. This preemptive creation ensures that
@ the system does not change the ordering of the root directory.
@
@ PRTPAR Printer parameters.
@ IOPAR IO parameters.
@
@ They USER Keys are defined and so are the System flags.
@ A comment has to be removed to enable this feature.
@
@ Usage :
@ 1: No parameters required.
@ TOOLS
@ 1: Returns Nothing
@
@---------------------------------------
\<<
{
@
@ ---
@ Create a Polynomial
@
@ 2: 'X' Variable
@ 1: { 1 2 -3 4 } List of Polynomial coefficients.
@ POLY
@ 1: 'X^3+2*X^2-3*X+4' Polynomial
@
'POLY'
\<< \-> v l
\<< l SIZE \-> n
\<< 0 n 1 - 0
FOR i
l n i - GET v i ^ * +
-1 STEP
\>>
\>>
\>>
@
@ ---
@ Synthetic Polynomial Division
@
@ 2: { 2 11 17 6 } 2*X^3 + 11*X^2 + 17*X + 6
@ 1: { 2 1 } divided 2*X + 1
@ SYND
@ 2: { 0 } Remainder : 0
@ 1: { 1 5 6 } Quotient : X^2 + 5*X + 6
@
'SYND'
\<< \-> A B
\<< A SIZE B SIZE DUP2 - 1 + OVER 1 -
\-> n m q r
\<< 1 n
FOR i
A i GET 2 i q - 1 + MAX m
FOR j
IF j i \<=
THEN j PICK B j GET * -
END
NEXT
IF i q \<=
THEN B 1 GET /
END
NEXT
r \->LIST q 1 + ROLLD q \->LIST
\>>
\>>
\>>
@
@ ---
@ Create a Binomial
@
@ 2: 'X' Variable
@ 1: { 1 2 -3 } List of roots.
@ BINO
@ 1: '(X-1)*(X-2)*(X+3)' Binomial
@
@
'BINO'
\<< \-> v l
\<< 1 1 l SIZE
FOR i
v l i GET - *
NEXT
\>>
\>>
@
@ ---
@ Expand and Collect Fully
@
@ 1: '(X-1)*(X-2)'
@ EXCO
@ 1: '2+X^2-3*X'
@
'EXCO'
\<<
DO DUP EXPAN SWAP
UNTIL OVER SAME
END
DO DUP COLCT SWAP
UNTIL OVER SAME
END
\>>
@
@ ---
@ Repeated Eval (until no change)
@
'REVAL'
\<<
DO DUP EVAL SWAP
UNTIL OVER SAME
END
\>>
@
@ ---
@ Greatest Common Divisor.
@
'GCD'
\<<
WHILE DUP
REPEAT SWAP OVER MOD
END DROP
\>>
@
@ ---
@ Least Common Multiple
@
'LCM'
\<< \-> a b
\<< a b * a b GCD /
\>>
\>>
@
@ ---
@ Create a list of numbers from 0 to N
@
@ 1: 5 n
@ IOTA
@ 1: { 0 1 2 3 4 5 } Generates n+1 elements.
@
'IOTA'
\<< \-> n
\<< 0 n
FOR i i
NEXT
n 1 + \->LIST
\>>
\>>
@
@ ---
@ Invert list.
@
@ 1: { 0 1 2 3 4 5 }
@ LINV
@ 1: { 5 4 3 2 1 0 }
@
'LINV'
\<< \-> L
\<< L SIZE 1
FOR i
L i GET
-1 STEP
L SIZE \->LIST
\>>
\>>
@
@ ---
@ Rotate a list Right
@
@ 1: { 0 1 2 3 4 5 }
@ LST\->
@ 1: { 5 0 1 2 3 4 }
@
'LST\->'
\<< OBJ\-> \-> SZ
\<< SZ ROLLD SZ \->LIST
\>>
\>>
@
@
@ ---
@ Rotate a list Left
@
@ 1: { 0 1 2 3 4 5 }
@ LST\<-
@ 1: { 1 2 3 4 5 0 }
@
'LST\<-'
\<< OBJ\-> \-> SZ
\<< SZ ROLL SZ \->LIST
\>>
\>>
@
@ ---
@ List OP.
@
@ 2: { 0 1 2 3 4 5 }
@ 1: \<< 1 + \>> Increment each element of list.
@ LOP
@ 1: { 1 2 3 4 5 6 }
@
'LOP'
\<< \-> l f
\<< 1 l SIZE
FOR i
l i GET f EVAL
NEXT l
SIZE \->LIST
\>>
\>>
@
@ ---
@ List Parallel Process.
@
@ 3: { 0 1 2 3 4 5 }
@ 2: { 5 4 3 2 1 0 }
@ 1: \<< * \>> Multiply corresponding elements.
@ LPP
@ 1: { 0 4 6 6 4 0 }
@
'LPP'
\<< \-> A B f
\<< A SIZE B SIZE MIN
\-> m
\<< 1 m
FOR i
A i GET B i GET f EVAL
NEXT m \->LIST
\>>
\>>
\>>
@
@ ---
@ List Reduce.
@
@ 2: { 0 1 2 3 4 5 }
@ 1: \<< + \>> Sum the elements of the list.
@ LRED
@ 1: 15
@
'LRED'
\<< \-> L f
\<< L 1 GET 2 L SIZE
FOR i
L i GET f EVAL
NEXT
\>>
\>>
@
@ ---
@ List range
@
@ 1: { 3 4 -2 1 8 }
@ LRNG
@ 2: -2 Minimum element of list.
@ 1: 8 Maximum element of list.
@
'LRNG'
\<< \-> L
\<< L 1 GET DUP 2 L SIZE
FOR i L i GET
\-> m n x @ m=min n=max x=element under test.
\<< m x MIN n x MAX
\>>
NEXT
\>>
\>>
@
@ ---
@ Linear Convolution (Multiply two polynomials)
@
@ 2: { 1 2 1 } X^2+2*X+1
@ 1: { 1 3 3 1 } X^3+3*X^2+3*X+1
@ LCONVL
@ 1: { 1 5 10 10 5 1 } X^5 + 5*X^4 + 10*X^3 + 10*X^2 + 5*X + 1
@
'LCONVL'
\<< \-> H X
\<< X SIZE H SIZE OVER + 1 - \-> N1 N @ N Size of X
\<< 1 N @ N Size of result
FOR n
0 1 N1
FOR k
H n k - 1 +
IFERR GET @ Try and get element from list.
THEN DROP2 @ Out of bounds, It is zero.
ELSE X k GET * +
END
NEXT
NEXT N \->LIST
\>>
\>>
\>>
@
@ ---
@ Executes operation N times.
@
@ 4: { 1 1 }
@ 3: { 1 1 } Raise this poly to the 4th power.
@ 2: \<< OVER LCONVL \>>
@ 1: 4
@ LOOP
@ 2: { 1 1 }
@ 1: { 1 5 10 10 5 1 }
@
'LOOP'
\<< \-> f n
\<<
WHILE 'n' DECR 0 \>=
REPEAT f EVAL
END
\>>
\>>
@
@ ---
@ Creates List of n+1 elements from a to b.
@
@ 3: 5 Want 5+1 elements
@ 2: 1 From 1
@ 1: 2 To 2
@ FROMTO
@ 1: { 1 1.2 1.4 1.6 1.8 2 }
@
'FROMTO'
\<< \-> n a b
\<< n IOTA
\<< b a - n / * a +
\>> LOP
\>>
\>>
@
} @ End list of tools.
@
@
@ Store programs into variable names.
@
OBJ\-> 2 / 1 SWAP @ Number of STO operations.
START
SWAP STO
NEXT
@---------------------------------------
@ Initialize some variables in the ROOT.
@ Here are some place holders. They are used so the root directory does not
@ have to be resorted after extraction, feel free to delete.
@
{
'PRTPAR'
{ }
'IOPAR'
{ }
}
@
@ End of list of variables.
@
@
OBJ\-> 2 / 1 SWAP @ Number of STO operations.
START
SWAP STO
NEXT
@---------------------------------------
@
@ Create these Directories in the ROOT.
@
{
'EE' 'ETC' 'ECON' 'HELP' 'STATS' 'TMP'
}
@
OBJ\-> 1 SWAP @ Number of STO operations.
START
CRDIR
NEXT
@---------------------------------------
@
@ Setup User Keys.
@
{
S
\<< \-> m y
\<< PATH ETC m y CALEND EVAL
\>>
\>> 13.1 @ C
\<< DOC TMENU
\>> 14.1 @ D
\<< PATH ETC TEA EVAL
\>> 42.1 @ T
MKDOC 14.2 @ Gold-D
EXCO 15.1 @ E
FROMTO 16.1 @ F
GCD 21.1 @ G
IOTA 23.1 @ I
LINV 23.2 @ Gold-I
LOOP 26.1 @ L
LOP 33.1 @ O
LPP 34.1 @ P
LRED 36.1 @ R
LRNG 36.2 @ Gold-R
}
@ Remove comment if you want keys.
@ STOKEYS
DROP @ and remove this line too.
@---------------------------------------
@
@ Setup Flags the way I like them
@
{ # 8081208081050FF2h # 0h }
@ Remove comment if you want flags.
@ STOF
DROP @ and remove this line too.
\>>
From helens!shelby!rutgers!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!mcgill-vision!jean Thu May 24 03:08:27 PDT 1990
Status: RO
Article 1726 of comp.sys.handhelds:
Path: helens!shelby!rutgers!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!mcgill-vision!jean
>From: jean@mcgill-vision.uucp (Pierre Racz)
Newsgroups: comp.sys.handhelds
Subject: An HP48 tool box
Message-ID: <1990May23.013801.7712@larry.mcrcim.mcgill.edu>
Date: 23 May 90 01:38:01 GMT
Sender: root@larry.mcrcim.mcgill.edu (el Root)
Reply-To: pierrer@pike.ee.mcgill.ca (Pierre Racz)
Organization: Electrical Engineering McGill University
Lines: 461
%%HP: T(3)A(R)F(.);
@ Name : TOOLS - Self extracting toolbox.
@ Author : Pierre Racz & Gregor Winslow
@ Email : pierrer <at> pike.ee.mcgill.ca
@ Date : 90-04-29
@ Release : 1.0
@
@ Checksum : # 4494h
@ Bytes : 2,175.5
@
@ Descrip :
@ Self extracting list of functions.
@ This program is designed to setup the HP48SX with global
@ utilities, variables and directories.
@
@ Simply execute it in the directory of your choice (presumably
@ the ROOT).
@
@ The following functions are extracted:
@
@ IOTA Create a list of integers.
@ LOP Apply an operator to elements of a list.
@ LPP Apply an operator on elements of two lists in parallel.
@ LRED Reduce a list into a scalar given an operator.
@ LRNG Returns the Minimum and Maximum of a list.
@ LINV Invert a list
@ LST\-> Shift a list right
@ LST\<- Shift a list left
@ LCONVL Produces a Linear Convolution of two lists.
@ LOOP Apply an operator n times.
@ FROMTO Generate n+1 numbers in given range.
@ GCD Greatest Common Divisor
@ LCM Least Common Multiple
@ POLY Create a polynomial algebraic form list of coefficients.
@ BINO Create a binomial algebraic form list of roots.
@ SYND Synthetic division of two polynomials.
@ EXCO Fully expand then fully collect.
@ REVAL Fully evaluate.
@
@ The following empty directories are created:
@
@ EE Engineering applications
@ ETC Miscellaneous applications
@ ECON Time Value of Money
@ HELP General information storage
@ STATS Stat functions
@ TMP Temp
@
@ The following (dummy) variables are created. They are
@ essentially place holders for variables that the system
@ automatically creates. This preemptive creation ensures that
@ the system does not change the ordering of the root directory.
@
@ PRTPAR Printer parameters.
@ IOPAR IO parameters.
@
@ They USER Keys are defined and so are the System flags.
@ A comment has to be removed to enable this feature.
@
@ Usage :
@ 1: No parameters required.
@ TOOLS
@ 1: Returns Nothing
@
@---------------------------------------
\<<
{
@
@ ---
@ Create a Polynomial
@
@ 2: 'X' Variable
@ 1: { 1 2 -3 4 } List of Polynomial coefficients.
@ POLY
@ 1: 'X^3+2*X^2-3*X+4' Polynomial
@
'POLY'
\<< \-> v l
\<< l SIZE \-> n
\<< 0 n 1 - 0
FOR i
l n i - GET v i ^ * +
-1 STEP
\>>
\>>
\>>
@
@ ---
@ Synthetic Polynomial Division
@
@ 2: { 2 11 17 6 } 2*X^3 + 11*X^2 + 17*X + 6
@ 1: { 2 1 } divided 2*X + 1
@ SYND
@ 2: { 0 } Remainder : 0
@ 1: { 1 5 6 } Quotient : X^2 + 5*X + 6
@
'SYND'
\<< \-> A B
\<< A SIZE B SIZE DUP2 - 1 + OVER 1 -
\-> n m q r
\<< 1 n
FOR i
A i GET 2 i q - 1 + MAX m
FOR j
IF j i \<=
THEN j PICK B j GET * -
END
NEXT
IF i q \<=
THEN B 1 GET /
END
NEXT
r \->LIST q 1 + ROLLD q \->LIST
\>>
\>>
\>>
@
@ ---
@ Create a Binomial
@
@ 2: 'X' Variable
@ 1: { 1 2 -3 } List of roots.
@ BINO
@ 1: '(X-1)*(X-2)*(X+3)' Binomial
@
@
'BINO'
\<< \-> v l
\<< 1 1 l SIZE
FOR i
v l i GET - *
NEXT
\>>
\>>
@
@ ---
@ Expand and Collect Fully
@
@ 1: '(X-1)*(X-2)'
@ EXCO
@ 1: '2+X^2-3*X'
@
'EXCO'
\<<
DO DUP EXPAN SWAP
UNTIL OVER SAME
END
DO DUP COLCT SWAP
UNTIL OVER SAME
END
\>>
@
@ ---
@ Repeated Eval (until no change)
@
'REVAL'
\<<
DO DUP EVAL SWAP
UNTIL OVER SAME
END
\>>
@
@ ---
@ Greatest Common Divisor.
@
'GCD'
\<<
WHILE DUP
REPEAT SWAP OVER MOD
END DROP
\>>
@
@ ---
@ Least Common Multiple
@
'LCM'
\<< \-> a b
\<< a b * a b GCD /
\>>
\>>
@
@ ---
@ Create a list of numbers from 0 to N
@
@ 1: 5 n
@ IOTA
@ 1: { 0 1 2 3 4 5 } Generates n+1 elements.
@
'IOTA'
\<< \-> n
\<< 0 n
FOR i i
NEXT
n 1 + \->LIST
\>>
\>>
@
@ ---
@ Invert list.
@
@ 1: { 0 1 2 3 4 5 }
@ LINV
@ 1: { 5 4 3 2 1 0 }
@
'LINV'
\<< \-> L
\<< L SIZE 1
FOR i
L i GET
-1 STEP
L SIZE \->LIST
\>>
\>>
@
@ ---
@ Rotate a list Right
@
@ 1: { 0 1 2 3 4 5 }
@ LST\->
@ 1: { 5 0 1 2 3 4 }
@
'LST\->'
\<< OBJ\-> \-> SZ
\<< SZ ROLLD SZ \->LIST
\>>
\>>
@
@
@ ---
@ Rotate a list Left
@
@ 1: { 0 1 2 3 4 5 }
@ LST\<-
@ 1: { 1 2 3 4 5 0 }
@
'LST\<-'
\<< OBJ\-> \-> SZ
\<< SZ ROLL SZ \->LIST
\>>
\>>
@
@ ---
@ List OP.
@
@ 2: { 0 1 2 3 4 5 }
@ 1: \<< 1 + \>> Increment each element of list.
@ LOP
@ 1: { 1 2 3 4 5 6 }
@
'LOP'
\<< \-> l f
\<< 1 l SIZE
FOR i
l i GET f EVAL
NEXT l
SIZE \->LIST
\>>
\>>
@
@ ---
@ List Parallel Process.
@
@ 3: { 0 1 2 3 4 5 }
@ 2: { 5 4 3 2 1 0 }
@ 1: \<< * \>> Multiply corresponding elements.
@ LPP
@ 1: { 0 4 6 6 4 0 }
@
'LPP'
\<< \-> A B f
\<< A SIZE B SIZE MIN
\-> m
\<< 1 m
FOR i
A i GET B i GET f EVAL
NEXT m \->LIST
\>>
\>>
\>>
@
@ ---
@ List Reduce.
@
@ 2: { 0 1 2 3 4 5 }
@ 1: \<< + \>> Sum the elements of the list.
@ LRED
@ 1: 15
@
'LRED'
\<< \-> L f
\<< L 1 GET 2 L SIZE
FOR i
L i GET f EVAL
NEXT
\>>
\>>
@
@ ---
@ List range
@
@ 1: { 3 4 -2 1 8 }
@ LRNG
@ 2: -2 Minimum element of list.
@ 1: 8 Maximum element of list.
@
'LRNG'
\<< \-> L
\<< L 1 GET DUP 2 L SIZE
FOR i L i GET
\-> m n x @ m=min n=max x=element under test.
\<< m x MIN n x MAX
\>>
NEXT
\>>
\>>
@
@ ---
@ Linear Convolution (Multiply two polynomials)
@
@ 2: { 1 2 1 } X^2+2*X+1
@ 1: { 1 3 3 1 } X^3+3*X^2+3*X+1
@ LCONVL
@ 1: { 1 5 10 10 5 1 } X^5 + 5*X^4 + 10*X^3 + 10*X^2 + 5*X + 1
@
'LCONVL'
\<< \-> H X
\<< X SIZE H SIZE OVER + 1 - \-> N1 N @ N Size of X
\<< 1 N @ N Size of result
FOR n
0 1 N1
FOR k
H n k - 1 +
IFERR GET @ Try and get element from list.
THEN DROP2 @ Out of bounds, It is zero.
ELSE X k GET * +
END
NEXT
NEXT N \->LIST
\>>
\>>
\>>
@
@ ---
@ Executes operation N times.
@
@ 4: { 1 1 }
@ 3: { 1 1 } Raise this poly to the 4th power.
@ 2: \<< OVER LCONVL \>>
@ 1: 4
@ LOOP
@ 2: { 1 1 }
@ 1: { 1 5 10 10 5 1 }
@
'LOOP'
\<< \-> f n
\<<
WHILE 'n' DECR 0 \>=
REPEAT f EVAL
END
\>>
\>>
@
@ ---
@ Creates List of n+1 elements from a to b.
@
@ 3: 5 Want 5+1 elements
@ 2: 1 From 1
@ 1: 2 To 2
@ FROMTO
@ 1: { 1 1.2 1.4 1.6 1.8 2 }
@
'FROMTO'
\<< \-> n a b
\<< n IOTA
\<< b a - n / * a +
\>> LOP
\>>
\>>
@
} @ End list of tools.
@
@
@ Store programs into variable names.
@
OBJ\-> 2 / 1 SWAP @ Number of STO operations.
START
SWAP STO
NEXT
@---------------------------------------
@ Initialize some variables in the ROOT.
@ Here are some place holders. They are used so the root directory does not
@ have to be resorted after extraction, feel free to delete.
@
{
'PRTPAR'
{ }
'IOPAR'
{ }
}
@
@ End of list of variables.
@
@
OBJ\-> 2 / 1 SWAP @ Number of STO operations.
START
SWAP STO
NEXT
@---------------------------------------
@
@ Create these Directories in the ROOT.
@
{
'EE' 'ETC' 'ECON' 'HELP' 'STATS' 'TMP'
}
@
OBJ\-> 1 SWAP @ Number of STO operations.
START
CRDIR
NEXT
@---------------------------------------
@
@ Setup User Keys.
@
{
S
\<< \-> m y
\<< PATH ETC m y CALEND EVAL
\>>
\>> 13.1 @ C
\<< DOC TMENU
\>> 14.1 @ D
\<< PATH ETC TEA EVAL
\>> 42.1 @ T
MKDOC 14.2 @ Gold-D
EXCO 15.1 @ E
FROMTO 16.1 @ F
GCD 21.1 @ G
IOTA 23.1 @ I
LINV 23.2 @ Gold-I
LOOP 26.1 @ L
LOP 33.1 @ O
LPP 34.1 @ P
LRED 36.1 @ R
LRNG 36.2 @ Gold-R
}
@ Remove comment if you want keys.
@ STOKEYS
DROP @ and remove this line too.
@---------------------------------------
@
@ Setup Flags the way I like them
@
{ # 8081208081050FF2h # 0h }
@ Remove comment if you want flags.
@ STOF
DROP @ and remove this line too.
\>>
From helens!shelby!rutgers!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!mcgill-vision!jean Thu May 24 03:09:19 PDT 1990
Status: RO
Article 1731 of comp.sys.handhelds:
Path: helens!shelby!rutgers!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!mcgill-vision!jean
>From: jean@mcgill-vision.uucp (Pierre Racz)
Newsgroups: comp.sys.handhelds
Subject: HP48 Tool box : Engineering Economy
Message-ID: <1990May23.154022.2101@larry.mcrcim.mcgill.edu>
Date: 23 May 90 15:40:22 GMT
Sender: news@larry.mcrcim.mcgill.edu (Usenet File Owner)
Reply-To: pierrer@pike.ee.mcgill.ca (Pierre Racz)
Organization: Electrical Engineering McGill University
Lines: 148
%%HP: T(3)A(R)F(.);
@ Name : ECON - Engineering Economy Tools
@ Author : Pierre Racz
@ Email : pierrer <at> pike.ee.mcgill.ca
@ Date : 90-04-29
@ Release : 1.0
@
@ Checksum : # CE47h
@ Bytes : 900.0
@
@ Descrip :
@ This file contains a directory hierarchy for time-value-of-money
@ computations. The main directory holds the TVM functions,
@ custom menu initialization and a DATA subdirectory where
@ the computations should be performed.
@
@ The following functions have been implemented:
@
@ F<-P Future given present.
@ P<-A Present given annuity.
@ F<-A Future given annuity.
@ P<-G Present given gradient.
@ F<-G Future given gradient.
@ A<-G Annuity given gradient.
@ P<-C Present given Constant rate of change.
@ PRINC Principal remaining on loan.
@ EIR Effective interest rate.
@ NIR Nominal interest rate.
@
DIR
@
@ Time Value of Money functions.
@
@
DATA @ Empty directory for YOUR data.
DIR
END
@
@ ----
@ Custom menu
@
CST { F\<-P P\<-A F\<-A P\<-G F\<-G A\<-G P\<-C PRINC EIR NIR }
@
@ ----
@ Future given Present.
@
@ i : Interest rate per period.
@ n : Number of periods.
@
F\<-P
\<< \-> i n '(1+i)^n'
\>>
@
@ ----
@ Present given Annuity
@
@ i : Interest rate per period.
@ n : Number of periods.
@
P\<-A
\<< \-> i n 'F\<-A(i,n)/F\<-P(i,n)'
\>>
@
@ ----
@ Future given Annuity
@
@ i : Interest rate per period.
@ n : Number of periods.
@
F\<-A
\<< \-> i n '((1+i)^n-1)/i'
\>>
@
@ ----
@ Present given Gradient
@
@ i : Interest rate per period.
@ n : Number of periods.
@
P\<-G
\<< \-> i n 'P\<-A(i,
n)*A\<-G(i,n)'
\>>
@
@ ----
@ Future given Gradient
@
@ i : Interest rate per period.
@ n : Number of periods.
@
F\<-G
\<< \-> i n 'F\<-A(i,n)*A\<-G(i,n)'
\>>
@
@ ----
@ Annuity given Gradient
@
@ i : Interest rate per period.
@ n : Number of periods.
@
A\<-G
\<< \-> i n '1/i-n/((1+i)^n-1)'
\>>
@
@ ----
@ Principal remaining on loan.
@
@ i : Interest rate per period.
@ n : Number of periods into loan.
@ N : Number of periods before payback of loan.
@
PRINC
\<< \-> i n N 'F\<-P(i,n)-P\<-C(0,i,n)/P\<-A(i,N)'
\>>
@
@ ----
@ Effective Interest Rate.
@
@ i : Interest rate per period.
@ n : Number of periods.
@
EIR
\<< \-> i n '(1+i/n)^n-1'
\>>
@
@ ----
@ Nominal Interest Rate
@
@ i : Interest rate per period.
@ n : Number of periods.
@
NIR
\<< \-> i n 'n*((1+i)^(1/n)-1)'
\>>
@
@ ----
@ Present Given Changing Annuity
@
@ i : Interest rate per period.
@ k : Rate at which receipts increase.
@ n : Number of periods.
@
P\<-C
\<< \-> i k n '(1-((1+k)/(1+i))^n)/(i-k)'
\>>
END
@
@